// void, Obj me, Item item, Obj h

Unit this;

Sleep(rand(100)+10);
this = me.AsUnit();

if (.IsValid) {// leave parry mode at new command
	.SetParryMode(false);
	if(.item_count > 0){
		Item item;
		
		item = .FindItem("Terrain bonus I");
		if(item.IsValid)
			.RemoveItemsOfType("Terrain bonus I");
		else {
			item = .FindItem("Terrain bonus II");
			if(item.IsValid)
				.RemoveItemsOfType("Terrain bonus II");
			else {
				item = .FindItem("Terrain bonus III");
				if(item.IsValid)
					.RemoveItemsOfType("Terrain bonus III");
				else {
					item = .FindItem("Terrain bonus IV");
					if(item.IsValid)
						.RemoveItemsOfType("Terrain bonus IV");
				}
			}
		}
	}
}

//.pr("chasing unit to give him something");

while(!.Goto(h, GetConst("GiveDistance"), 1500, true, 5000));
if(!.IsVisible)
	.SetVisible(true);
if (.HasSpecial(sneak)) .SetLastAttackTime(); // mountaineer patch
h.GiveItem(item, this); // Ako stane - stane :)
